package cn.jhz.learn.blog.component;


import cn.jhz.learn.blog.po.article.*;
import cn.jhz.learn.blog.po.blogger.*;
import cn.jhz.learn.blog.po.file.BlogFile;


public final class GLOBAL {
    private GLOBAL(){}

    public static final class PARAM {
        public static final class QUERY{
            /*文章类型*/
            public static final Byte IS_ORIGINAL = 1;
            public static final Byte IS_NOT_ORIGINAL = 0;
        }
        public static final class SUBMIT{
            /*文章参数*/
            public static final Byte ORIGINAL = 0;
            public static final Byte COPIED = 1;
            public static final Byte TRANSLATED = 2;
        }
    }
    
    public static final class VALIDATION_KEY{
        private VALIDATION_KEY(){}
        /*CLASS*/
        private static final String VISIBILITY_ID = "VISIBILITY_ID";
        private static final String VISIBILITY_BLOG_NAME = "VISIBILITY_BLOG_NAME";
        private static final String VISIBILITY_UID = "VISIBILITY_UID";
        private static final String STATUS_ID = "STATUS_ID";
        private static final String STATUS_UID = "STATUS_UID";
        private static final String UID = "UID";
        private static final String STATUS_BLOG_NAME = "STATUS_BLOG_NAME";
        private static final String BLOG_NAME = "BLOG_NAME";
        private static final String ID = "ID";
        /*OWN_ENTITY*/
        private static final String blog = "BLOG";
        private static final String article = "ARTICLE";
        private static final String articles = "ARTICLES";
        private static final String subfield = "SUBFIELD";
        private static final String subfields = "SUBFIELDS";
        private static final String visibility = "VISIBILITY";
        private static final String status = "STATUS";
        private static final String own_level = "OWN_LEVEL";

        /*OWN_ENTITY*/
        public static final class OWN_ENTITY_ARTICLE{
            
            public static final String VISIBILITY = article + visibility;
            public static final String STATUS = article + status;
        }
        public static final class OWN_ENTITY_SUBFIELD{
            private OWN_ENTITY_SUBFIELD(){}
            public static final String VISIBILITY = subfield + visibility;
            public static final String STATUS = subfield + visibility;
            public static final class ARTICLES{
                public static final String VISIBILITY = subfield + articles + visibility;
                public static final String STATUS = subfield + articles + status;
            }
        }
        public static final class OWN_ENTITY_BLOG {
            public static final String OWN_LEVEL = blog + own_level;
            public static final class ARTICLES {
                public static final String VISIBILITY = blog + articles + visibility;
                public static final String STATUS = blog + articles + status;
            }
            public static final class SUBFIELDS {
                public static final String VISIBILITY = blog + subfields + visibility;
                public static final String STATUS = blog + subfields + status;
            }
        }
        /*CLASS*/
        public static final class CLASS_BLOG_BLOGGER {
            private CLASS_BLOG_BLOGGER(){}
            public static final String BLOG_NAME = BlogBlogger.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogBlogger.class.getName() + VALIDATION_KEY.ID;
            public static final String UID = BlogBlogger.class.getName() + VALIDATION_KEY.UID;
            public static final String STATUS_ID = BlogBlogger.class.getName() + VALIDATION_KEY.STATUS_ID;
            public static final String STATUS_UID = BlogBlogger.class.getName() + VALIDATION_KEY.STATUS_UID;
            public static final String STATUS_BLOG_NAME = BlogBlogger.class.getName() + VALIDATION_KEY.STATUS_BLOG_NAME;
            public static final String VISIBILITY_BLOG_NAME = BlogBlogger.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogBlogger.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_UID = BlogBlogger.class.getName() + VALIDATION_KEY.VISIBILITY_UID;
        }
        public static final class CLASS_BLOG_ARTICLE {
            private CLASS_BLOG_ARTICLE() {}
            public static final String ID = BlogArticle.class.getName() + VALIDATION_KEY.ID;
        }
        public static final class CLASS_BLOG_ARTICLE_SUBFIELD {
            private CLASS_BLOG_ARTICLE_SUBFIELD() {}
            public static final String BLOG_NAME = BlogArticleSubfield.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogArticleSubfield.class.getName() + VALIDATION_KEY.ID;
            public static final String VISIBILITY_BLOG_NAME = BlogArticleSubfield.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogArticleSubfield.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String STATUS_ID = BlogArticleSubfield.class.getName() + VALIDATION_KEY.STATUS_ID;
        }
        public static final class CLASS_BLOG_ARTICLE_SUBFIELD_SUBSCRIBE{
            private CLASS_BLOG_ARTICLE_SUBFIELD_SUBSCRIBE() {}
            public static final String BLOG_NAME = BlogArticleSubfieldSubscribe.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogArticleSubfieldSubscribe.class.getName() + VALIDATION_KEY.ID;
            public static final String VISIBILITY_BLOG_NAME = BlogArticleSubfieldSubscribe.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogArticleSubfieldSubscribe.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
        }
        public static final class CLASS_BLOG_ARTICLE_SUBFIELD_ASSOCIATIVE {
            private CLASS_BLOG_ARTICLE_SUBFIELD_ASSOCIATIVE() {}
            public static final String BLOG_NAME = BlogArticleSubfieldAssociative.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogArticleSubfieldAssociative.class.getName() + VALIDATION_KEY.ID;
            public static final String VISIBILITY_BLOG_NAME = BlogArticleSubfieldAssociative.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogArticleSubfieldAssociative.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
        }
        public static final class CLASS_BLOG_ARTICLE_ACCESS {
            private CLASS_BLOG_ARTICLE_ACCESS() {}
            public static final String BLOG_NAME = BlogArticleAccess.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogArticleAccess.class.getName() + VALIDATION_KEY.ID;
            public static final String VISIBILITY_BLOG_NAME = BlogArticleAccess.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogArticleAccess.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
        }
        public static final class CLASS_BLOG_BLOGGER_SUBSCRIBE {
            private CLASS_BLOG_BLOGGER_SUBSCRIBE() {}
            public static final String BLOG_NAME = BlogBloggerSubscribe.class.getName() + VALIDATION_KEY.BLOG_NAME;
            public static final String ID = BlogBloggerSubscribe.class.getName() + VALIDATION_KEY.ID;
            public static final String VISIBILITY_BLOG_NAME = BlogBloggerSubscribe.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
            public static final String VISIBILITY_ID = BlogBloggerSubscribe.class.getName() + VALIDATION_KEY.VISIBILITY_BLOG_NAME;
        }
        public static final class CLASS_BLOG_FILE{
            public static final String ID = BlogFile.class.getName() + VALIDATION_KEY.ID;
            public static final String SIGNATURE_CODE = BlogFile.class.getName() + "SIGNATURE_CODE";
        }
    }

    public static final class PARAM_EXCEPTION_TYPE {
        private PARAM_EXCEPTION_TYPE(){}
    }
    
    public static final class RESOURCE{
        public static final class VISIBILITY{
            private VISIBILITY(){}
            public static final Byte PRIVATE = 0;
            public static final Byte OPEN = 1;
            public static final Byte SUBSCRIBE = 2;
            public static final Byte[] ALL = {PRIVATE, OPEN, SUBSCRIBE};
        }
        public static final class STATUS{
            private STATUS(){}
            public static final Byte DELETE = 0;
            public static final Byte VALID = 1;
            public static final Byte DRAFT = 2;
            public static final Byte AUDIT = 3;
            public static final Byte DISABLE = 4;
            public static final Byte[] ALL = {DELETE, VALID, DRAFT, AUDIT, DISABLE};
            public static final Byte[] VALID_ALL = {VALID, DRAFT, AUDIT, DISABLE};
        }
        public static final class TYPE{
            private TYPE(){}
            public static final Byte ORIGINAL = 0;
            public static final Byte COPIED = 1;
            public static final Byte TRANSLATED = 2;
            public static final Byte[] ALL = {ORIGINAL, COPIED, TRANSLATED};
        }
        public static final class STICK{
            private STICK(){}
            public static Byte IS = 1;
            public static Byte IS_NOT = 0;
        }
        public static final class OWN_LEVEL {
            public static final Byte OWN = 0;
            public static final Byte SUBSCRIBE = 2;
            public static final Byte PUBLIC = 1;
            public static final Byte[] ALL = {OWN, SUBSCRIBE, PUBLIC};
        }
    }

    public static final class TOKEN_INFO {
        private TOKEN_INFO(){}

        public static final String AUTH_HEADER = "X-Authorization-With";

        public static final int EXPIRATION_TIME_MINUTES_IN_THE_FUTURE = 10;

        public static final int NOT_BEFORE_MINUTES_IN_THE_PAST = 2;

        public static final int RSA_JSON_WEB_KEY_BITS = 2048;

        public static final String RSA_JSON_WEB_KEY_ID = "machine005@cn.jhz";

        public static final int ALLOWED_CLOCK_SKEW_IN_SECONDS = 30;

        public static final String ISSUER = "MACHINE_005";
    }
    public static final class HEADER_INFO {
        private HEADER_INFO(){}

        public static final String ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers";

        public static final String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-control-Allow-Origin";

        public static final String  ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods";

        public static final String  ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers";
    }
    
    
}
